package com.youdianstar.app.util.biometric;

import android.content.Context;

import javax.crypto.Cipher;

/**
 * File: ICryptographyManager
 * Author: 82149 Create: 2021/7/27 17:21
 * Changes (from 2021/7/27)
 * --------------------------------------------------
 * description:
 * ---------------------------------------------------
 */
public interface ICryptographyManager {
    Cipher getInitCipherForEncryption(String keyName);

    Cipher getInitCipherForDecryption(String keyName, byte[] initializationVector);

    CryptographyHelper.CipherTextWrapper encryptData(String plaintext, Cipher cipher);

    String decryptData(byte[] cipherText, Cipher cipher);

    void persistCipherTextWrapperToSP(CryptographyHelper.CipherTextWrapper ciphertextWrapper, Context context, String filename, int mode, String prefKey);

    CryptographyHelper.CipherTextWrapper getCipherTextWrapperFromSP(Context context, String filename, int mode, String prefKey);

    void cleanCipherTextWrapper(Context context, String filename, int mode, String prefKey);
}
